<?php
namespace app\common\validate;

use think\Validate;

class AudienceValidate extends Validate
{
    protected $rule =   [
        'id'                       => 'require|integer',
        'user_id|用户ID'           => 'require|integer',
        'page|页数'                => 'require|integer',
        'limit|条数'               => 'require|integer',
        'home_status|家庭状况'     => 'require|in:1,2',
        'address|地址'             => 'require|length:1,255',
        'resume|个人简历'          => 'require|length:1,500',
        'label_id|话题标签'        => 'require',
        'card_img|身份证正面'      => 'require',
        'card_img_back|身份证反面' => 'require',
        'edu_img|学历证'           => 'require',
        'qua_img|资格证'           => 'require',
        'type|标签类型'            => 'require|in:1,2,3',
        'back_msg|驳回理由'        => 'require|length:1,100',
    ];
    
    protected $scene = [
        /** api */
        'add'   => ['user_id', 'home_status', 'address', 'resume', 'label_id', 'card_img', 'card_img_back', 'edu_img', 'qua_img'],
        'type'  => ['type'],

        /** admin */
        'list'       => ['page', 'limit'],
        'admin_show' => ['id'],
        'admin_back' => ['id', 'back_msg'],
    ];
}